import os
import time

#检测连接及自动连接
op = os.popen('adb devices')
s = op.read()
ip = ''

#目标手机无线adb地址
ans="List of devices attached\n"+ip+"	device"
result = ans in s
if result == True:
    print("already connected")
else:
    print("connecting...")
    os.system('adb connect '+ip+'')
###################

#连点次数
r=int(input("次数(默认 1）：")or 1)

i=1

while i <= r:
    process=os.system('adb shell input tap 570 1982');#目标坐标1
    time.sleep(1)
    process=os.system('adb shell input tap 544 1547');#目标坐标2
    time.sleep(1)
    print("done",i)
    i+=1
print("finish")